/* eslint-disable prettier/prettier */
import gsap from 'gsap';
import { camera, controls } from './scene.js';
import { CSSRulePlugin } from 'gsap/CSSRulePlugin';
gsap.registerPlugin(CSSRulePlugin);
const cameraReset = (position, lookAt, time = 1) => {
  gsap.to(camera.position, {
    x: position.x,
    y: position.y,
    z: position.z,
    duration: time,
    ease: 'power4.out',
  });
  gsap.to(camera.lookAt, {
    x: lookAt.x,
    y: lookAt.y,
    z: lookAt.z,
    duration: time,
    ease: 'power4.out',
  });
  gsap.to(controls.target, {
    x: lookAt.x,
    y: lookAt.y,
    z: lookAt.z,
    duration: time,
    ease: 'power4.out',
  });
};

export { cameraReset };
